package cn.edu.hunau.dao;

import cn.edu.hunau.exception.DaoException;
import cn.edu.hunau.pojo.User;

/**
 * @Author 苏佳
 * @Date 2022 12 02 11 14
 **/
public interface UserDao {
    /**
     * 创建用户 对应注册逻辑
     * @param user
     * @return
     */
    User createUser(User user) throws DaoException;

    /**
     * 查询用户 对应登录的逻辑
     * @param username
     * @param pwd
     * @return
     */
    User queryByUserNameAndPwd(String username,String pwd) throws DaoException;

    User queryByTelAndPwd(String tel,String pwd)throws DaoException;
    /**
     * 根据用户名查询用户 判断用户名是否重复
     * @param username
     * @return
     */
    User queryByUsername(String username) throws DaoException;

    /**
     * 绑定手机号码
     * @param tel
     * @param uid
     * @throws DaoException
     */
    void bingingTel(String tel,Integer uid)throws DaoException;

    /**
     * 修改密码
     * @param newPwd
     * @param uid
     * @throws DaoException
     */
    void updatePwd(String newPwd,Integer uid)throws DaoException;
    String queryPwdByUid(Integer uid)throws DaoException;

    User queryInforByUid(Integer uid)throws DaoException;
}
